DecodeDate

Syntax: @DecodeDate date_variable, day_variable, month_variable, year_variable

The DecodeDate command can be used to take a date variable and divide it up into three variables holding the day, month and year.

Example

@DecodeDate Todays_date, Day, Month, Year

There is also a mirror EncodeDate FUNCTION which can be used as shown in these examples:

@Assign Date_var = EncodeDate ( Day, Month, Year )

@Assign Date = EncodeDate ( 31, 12, 1999 )

Note that in both cases that the order or the variables supplied or received must use the English date format of Day, Month, Year. However, the target date variable used will cater for the date format of the country setting being used on the computer. For example, on a computer with a date setting for MM/DD/YYYY, this EncodeDate function:

@Assign Date_var = EncodeDate ( 31, 12, 1999 )

would result in 12/31/1999 in Date_var.

See also the example of Calculate Date of Birth.